const Options = {
    top: {
        title: {
            text: '排序图示例',
            subtext: 'top-chart',
            sublink: '#',
            // left: 'center',
        },
        xAxis: {
            type: 'value',
            show: false,
        },
        yAxis: {
            type: 'category',
            data: ['A111', 'B222', 'C333', 'D444', 'E5'],
            inverse: true,
            axisTick: { show: false },
        },
        series: [
            {
                realtimeSort: true,
                name: 'X',
                type: 'bar',
                data: [200, 3432, 1111, 434, 6645],
                label: {
                    show: true,
                    position: 'right',
                },
                showBackground: true,
                backgroundStyle: {
                    color: 'rgba(180, 180, 180, 0.2)',
                },
            },
        ],
    },
    bar: {
        title: {
            text: '柱状图示例',
            subtext: '数据来自网络',
        },
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow',
            },
        },
        legend: {
            data: ['2011年', '2012年'],
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true,
        },
        yAxis: {
            type: 'value',
            boundaryGap: [0, 0.01],
        },
        xAxis: {
            type: 'category',
            axisTick: { show: false },
            data: ['巴西', '印尼', '美国', '印度', '中国', '世界人口(万)'],
        },
        animationEasing: 'elasticOut',
        animationDelayUpdate: function (idx) {
            return idx * 5;
        },
        series: [
            {
                name: '2011年',
                type: 'bar',
                data: [18203, 23489, 29034, 104970, 131744, 630230],
                animationDelay: function (idx) {
                    return idx * 10;
                },
            },
            {
                name: '2012年',
                type: 'bar',
                data: [19325, 23438, 31000, 121594, 134141, 681807],
                animationDelay: function (idx) {
                    return idx * 10;
                },
            },
        ],
    },
    pie: {
        title: {
            text: '饼图示例',
            subtext: '纯属虚构',
            left: 'left',
        },
        tooltip: {
            trigger: 'item',
        },
        legend: {
            orient: 'vertical',
            right: 'right',
        },
        series: [
            {
                name: '访问来源',
                type: 'pie',
                radius: '50%',
                data: [
                    { value: 1048, name: '搜索引擎' },
                    { value: 735, name: '直接访问' },
                    { value: 580, name: '邮件营销' },
                    { value: 484, name: '联盟广告' },
                    { value: 300, name: '视频广告' },
                ],
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)',
                    },
                },
            },
        ],
    },
    circular: {
        title: {
            text: '环形图图示例',
            subtext: '',
            left: 'left',
        },
        tooltip: {
            trigger: 'item',
        },
        legend: {
            orient: 'vertical',
            right: 'right',
        },
        series: [
            {
                name: '',
                type: 'pie',
                radius: ['40%', '70%'],
                itemStyle: {
                    borderRadius: 10,
                    borderColor: '#fff',
                    borderWidth: 2,
                },
                data: [
                    { value: 1048, name: '搜索引擎' },
                    { value: 735, name: '直接访问' },
                    { value: 580, name: '邮件营销' },
                    { value: 484, name: '联盟广告' },
                    { value: 300, name: '视频广告' },
                ],
            },
        ],
    },
    line: {
        title: {
            text: '折线图示例',
        },
        tooltip: {
            trigger: 'axis',
        },
        legend: {
            type: 'scroll',
            top: '30',
            data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎', '搜索', '搜'],
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true,
        },
        toolbox: {
            feature: {
                magicType: {
                    type: ['line', 'bar', 'stack'],
                },
            },
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
        },
        yAxis: {
            type: 'value',
        },
        series: [
            {
                name: '邮件营销',
                type: 'line',
                smooth: true,
                data: [120, 132, 101, 134, 90, 230, 210],
            },
            {
                name: '联盟广告',
                type: 'line',
                smooth: true,
                data: [220, 182, 191, 234, 290, 330, 310],
            },
            {
                name: '视频广告',
                type: 'line',
                smooth: true,
                data: [150, 232, 201, 154, 190, 330, 410],
            },
            {
                name: '直接访问',
                type: 'line',
                smooth: true,
                data: [320, 332, 301, 334, 390, 330, 320],
            },
            {
                name: '搜索引擎',
                type: 'line',
                smooth: true,
                data: [820, 932, 901, 934, 1290, 1330, 1320],
            },
            {
                name: '搜索',
                type: 'line',
                smooth: true,
                data: [20, 932, 901, 934, 190, 1330, 120],
            },
            {
                name: '搜',
                type: 'line',
                smooth: true,
                data: [20, 932, 901, 934, 190, 1330, 120],
            },
        ],
    },
    gauge: {
        // 仪表图
        series: [
            {
                type: 'gauge',
                progress: {
                    show: true,
                    width: 19, // 数据宽度
                },
                axisLine: {
                    lineStyle: {
                        width: 19, // 数据背景宽度
                    },
                },
                itemStyle: {
                    color: '#58D9F9', // 数据颜色
                    shadowColor: 'rgba(0,138,255,0.7)',
                    shadowBlur: 10,
                    shadowOffsetX: 2,
                    shadowOffsetY: 2,
                },
                splitLine: {
                    show: false,
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    show: false,
                },
                pointer: {
                    show: false,
                },
                detail: {
                    valueAnimation: true,
                    fontSize: 50,
                    formatter: '> {value}', // 格式
                },
                title: {
                    offsetCenter: [0, '-20%'],
                    fontSize: 30,
                },
                data: [
                    {
                        value: '70',
                        name: '仪表图', // 名称
                    },
                ],
            },
        ],
    },
    radar: {
        title: {
            text: '基础雷达图',
        },
        legend: {
            orient: 'vertical',
            right: 'right',
            data: ['预算分配（Allocated Budget）', '实际开销（Actual Spending）'],
        },
        tooltip: {
            trigger: 'axis',
        },
        radar: {
            // shape: 'circle',
            indicator: [
                { name: '销售（Sales）', max: 6500 },
                { name: '管理（Administration）', max: 16000 },
                { name: '信息技术（Information Technology）', max: 30000 },
                { name: '客服（Customer Support）', max: 38000 },
                { name: '研发（Development）', max: 52000 },
                { name: '市场（Marketing）', max: 25000 },
            ],
        },
        series: [
            {
                name: '预算 vs 开销（Budget vs spending）',
                type: 'radar',
                tooltip: {
                    trigger: 'item',
                },
                symbol: 'none',
                areaStyle: {
                    opacity: 0.1,
                },
                data: [
                    {
                        value: [4200, 3000, 20000, 35000, 50000, 18000],
                        name: '预算分配（Allocated Budget）',
                    },
                    {
                        value: [5000, 14000, 28000, 26000, 42000, 21000],
                        name: '实际开销（Actual Spending）',
                    },
                ],
            },
        ],
    },
    funnel: {
        title: {
            text: '漏斗图',
            subtext: '纯属虚构',
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c}',
        },
        legend: {
            orient: 'vertical',
            right: 'right',
            data: ['展现', '点击', '访问', '咨询', '订单'],
        },

        series: [
            {
                name: '漏斗图',
                type: 'funnel',
                left: '10%',
                top: 60,
                //x2: 80,
                bottom: 60,
                width: '80%',
                // height: {totalHeight} - y - y2,
                min: 0,
                max: 100,
                minSize: '0%',
                maxSize: '100%',
                sort: 'descending',
                gap: 2,
                label: {
                    show: true,
                    position: 'inside',
                },
                labelLine: {
                    length: 10,
                    lineStyle: {
                        width: 1,
                        type: 'solid',
                    },
                },
                itemStyle: {
                    borderColor: '#fff',
                    borderWidth: 1,
                },
                emphasis: {
                    label: {
                        fontSize: 20,
                    },
                },
                data: [
                    { value: 60, name: '访问' },
                    { value: 40, name: '咨询' },
                    { value: 20, name: '订单' },
                    { value: 80, name: '点击' },
                    { value: 100, name: '展现' },
                ],
            },
        ],
    },
};
export default Options;
